#!/usr/bin/env python
import re
import sys

fd = open("moveData.txt")
ofd = open("outMoveData.txt", "w")

lines = []

while True:
    line = fd.readline()
    if not line:
        break
    fields = line.split()
    fields[1] = re.sub(r"_", " ", fields[1])
    lines.append(fields)

print >> ofd, "\n >>> NAME <<< \n"
for fields in lines:
    print >> ofd, "\"%s\"," %(fields[1]),

print >> ofd, "\n\n >>> TYPE <<< \n"
for fields in lines:
    print >> ofd, "\"%s\"," %(fields[2]),

print >> ofd, "\n\n >>> PP <<< \n"
for fields in lines:
    print >> ofd, "%s," %(fields[5]),

print >> ofd, "\n\n >>> POWER <<< \n"
for fields in lines:
    if fields[6] == "N/A":
        fields[6] = "-"
    print >> ofd, "%s," %(fields[6]),

print >> ofd, "\n\n >>> ACCURACY <<< \n"
for fields in lines:
    try:
        print >> ofd, "%s," %(fields[7]),
    except:
        print >> sys.stderr, "failed to process %s" % " ".join(fields)
